home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 32.0 KB | 1,032 lines | [TEXT/MPS ] |
- ;
- ; File: NameRegistry.a
- ;
- ; Contains: NameRegistry Interfaces
- ;
- ; Version: Technology: System 8
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__NAMEREGISTRY__') = 'UNDEFINED' THEN
- __NAMEREGISTRY__ SET 1
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
- ;
- ; These definitions apply to both the System7 and System8 interfaces
- ; RegEntryRef: The Global Entry Reference
- ;
- RegEntryRef RECORD 0
- contents ds.l 4 ; offset: $0 (0)
- sizeof EQU * ; size: $10 (16)
- ENDR
-
- kRegPathNameSeparator EQU 58 ; 0x3A
-
- kRegMaxPropertyNameLength EQU 31 ; Max length of Property Name (terminator not included)
- RegPropertyNameBuf RECORD 0
- elements ds.b 32
- sizeof EQU * ; size: $20 (32)
- ENDR
-
-
- ENDIF
- IF FOR_SYSTEM8_PREEMPTIVE THEN
- ;
- ;------------------------------------------------------------------------------------
- ;Name Registry Interface for System 8
- ;------------------------------------------------------------------------------------
- ;
- ;
- ;------------------------------------------------------------------------------------
- ; Foundation Types
- ;------------------------------------------------------------------------------------
- ;
- ; Entry Name Definitions (Entry Names are C-Strings)
-
- kRegMaxEntryNameLength EQU 47 ; Max length of a C-String Entry Name (terminator not included)
- ; length of RegEntryNameBuf = kRegMaxEntryNameLength +1
- RegEntryNameBuf RECORD 0
- elements ds.b 48
- sizeof EQU * ; size: $30 (48)
- ENDR
-
-
- ; Create Entry Options
- ; typedef OptionBits RegCreateEntryOptions
-
- ; use "kNilOptions" for no options
-
- kRegCreateResidentEntry EQU $00000001 ; make entry resident
- ; Delete Entry Options
- ; typedef OptionBits RegDeleteEntryOptions
-
- ; use "kNilOptions" for no options
-
- kRegDeleteEmbeddedEntries EQU $00000001 ; delete embedded entries
- ; Entry Iterator
-
-
- ; Entry Iterator Options
- ; typedef OptionBits RegEntryIteratorOptions
-
- ; use "kNilOptions" for no options
-
- kRegIterateEmbeddedEntries EQU $00000002 ; iterate embedded entries
- ;
- ; Property Instances
- ; An instance value for a property is assigned by the Name Registry when the
- ; instance is created. This value is used to distinguish this instance from any
- ; other instances of the property. Instance values are unique and persistent for
- ; the life of the property. Thus, clients can obtain a reference to a property (name
- ; and instance value) and use that reference until the property is deleted or the
- ; system is restarted. At restart, new instance values are assigned to all
- ; properties, including any restored persistent properties.
- ;
- ; typedef UInt32 RegPropertyInstance
-
-
- kRegNilPropertyInstance EQU $00000000 ; nil property instance
- kRegAnyPropertyInstance EQU $FFFFFFFF ; any property instance
- kRegAllPropertyInstances EQU $FFFFFFFE ; all property instances
- ; Create Property Options
- ; typedef OptionBits RegCreatePropertyOptions
-
- ; use "kNilOptions" for no options
-
- kRegMultiInstanceProperty EQU $00000001 ; multiple-instance property
- ; Property Iterator
-
-
- ; Transaction Reference
-
-
- ; Nil Transaction Reference
-
- kRegNilTransaction EQU 0
- ;
- ;------------------------------------------------------------------------------------
- ; Name Registry Calls
- ;------------------------------------------------------------------------------------
- ;
- ;
- ;------------------------------------------------------------------------------------
- ; EntryRef Handling
- ;------------------------------------------------------------------------------------
- ;
- ; Compare two EntryRef's for equality.
- ;
- ; extern Boolean RegEntryRefIsEqual(const RegEntryRef *ref1, const RegEntryRef *ref2)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegEntryRefIsEqual
- ENDIF
-
- ;
- ;------------------------------------------------------------------------------------
- ; Adding and Deleting Entries
- ;------------------------------------------------------------------------------------
- ;
- ;
- ; Create an Entry
- ; If (parentEntry) is NULL, the path name is assumed to be an absolute path name
- ; rooted to the anonymous, unnamed root.
- ; Note, RegCreateEntry only creates a single entry, the one at the end of the path.
- ; Thus, all parent entries along the path to the new entry (ancestors) must already
- ; exist.
- ;
- ;
- ; extern OSStatus RegCreateEntry(RegTransaction transaction, const RegEntryRef *parentEntry, const char *pathName, RegCreateEntryOptions options, RegEntryRef *newEntry)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegCreateEntry
- ENDIF
-
- ;
- ; Delete an Entry or Subtree
- ; RegDeleteEntry can be used to delete a single entry or a complete subtree.
- ; To delete a subtree, set the RegDeleteEmbedded option.
- ; All properties for deleted entries are also deleted.
- ;
- ;
- ; extern OSStatus RegDeleteEntry(RegTransaction transaction, const RegEntryRef *ref, RegDeleteEntryOptions options)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegDeleteEntry
- ENDIF
-
- ;
- ;------------------------------------------------------------------------------------
- ; LookUp Entry by Name
- ;------------------------------------------------------------------------------------
- ;
- ;
- ; Lookup Entry
- ; Locates an entry given a specified subroot (searchPointRef) and path name. If the
- ; searchPointRef pointer is NULL, the path name is assumed to be an absolute path
- ; name rooted to the root of the Registry.
- ;
- ;
- ; extern OSStatus RegLookupEntry(RegTransaction transaction, const RegEntryRef *searchPointRef, const char *pathName, RegEntryRef *foundEntry)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegLookupEntry
- ENDIF
-
- ;
- ;------------------------------------------------------------------------------------
- ;Get Entry Name and Parent
- ;------------------------------------------------------------------------------------
- ;
- ;
- ; Retrieve the name component for the specified entry, and return the EntryRef for
- ; the parent entry.
- ;
- ;
- ; extern OSStatus RegGetEntryName(RegTransaction transaction, const RegEntryRef *entryRef, RegEntryRef *parentEntry, char *nameComponent)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegGetEntryName
- ENDIF
-
- ;
- ;------------------------------------------------------------------------------------
- ;Get Path Name
- ;------------------------------------------------------------------------------------
- ;
- ;
- ; These are utility routines to turn an Entry ID back into a name string.
- ; Get Entry Path Size
- ; Note, path size is returned in bytes for C-String paths
- ;
- ;
- ; extern OSStatus RegGetEntryPathSize(RegTransaction transaction, const RegEntryRef *entryRef, ByteCount *pathSize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegGetEntryPathSize
- ENDIF
-
- ; Get Path Name
- ;
- ; extern OSStatus RegGetEntryPath(RegTransaction transaction, const RegEntryRef *entryRef, char *pathName, ByteCount pathSize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegGetEntryPath
- ENDIF
-
- ;
- ;------------------------------------------------------------------------------------
- ; Entry Iteration
- ;------------------------------------------------------------------------------------
- ;
- ;
- ; An Entry Iterator maintains three variables that are of interest to clients.
- ; First is an "OutermostScope" which defines the outer boundry of the iteration.
- ; This is defined by the starting entry and includes that entry plus all of it's
- ; embedded entries. Second is a "currentScope" which is the entry the iterator is
- ; currently in. And third is a "currentPosition" which is the last entry returned
- ; during an iteration.
- ; Create Entry Iterator
- ; Create the iterator structure. The outermostScope and currentScope of the iterator
- ; are set to "startEntry". If "startEntry" = NULL, the outermostScope and
- ; currentScope are set to the root entry. The currentPosition for the iterator is
- ; set to "nil".
- ; If propertyName != Null, propertyName, propertyValue, and propertySize are used
- ; to filter the entries returned during an iteration. If propertyName == Null, all
- ; entries are returned.
- ;
- ;
- ; extern OSStatus RegCreateEntryIterator(RegTransaction transaction, const RegEntryRef *startEntry, RegEntryIteratorOptions options, const char *propertyName, const void *propertyValue, ByteCount propertySize, RegEntryIterator *iterator)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegCreateEntryIterator
- ENDIF
-
- ; Dispose Entry Iterator
- ;
- ; extern OSStatus RegDisposeEntryIterator(RegEntryIterator iterator)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegDisposeEntryIterator
- ENDIF
-
- ;
- ; Enter Child Entry
- ; Move an Entry Iterator into the scope of a specified child entry. The
- ; currentScope of the iterator is set to the entry specified in "childEntry". If
- ; "childEntry" is nil, the currentScope is set to the entry specified by the
- ; currentPosition of the iterator.
- ; Note RegEnterEntry cannot be used if the "kRegIterateEmbeddedEntries" option was
- ; set when the iterator was created.
- ;
- ;
- ; extern OSStatus RegEnterEntry(RegTransaction transaction, RegEntryIterator iterator, RegEntryRef *childEntry)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegEnterEntry
- ENDIF
-
- ;
- ; Exit to Parent Entry
- ; Move an Entry Iterator out of the current entry back into the scope of it's parent
- ; entry. The currentPosition of the iterator is reset to the current entry (the
- ; previous currentScope), so the next iteration call will continue where it left off.
- ; This position is returned in parameter "currentPosition".
- ; Note RegExitEntry cannot be used if the "kRegIterateEmbeddedEntries" option was
- ; set when the iterator was created.
- ;
- ;
- ; extern OSStatus RegExitEntry(RegTransaction transaction, RegEntryIterator iterator, RegEntryRef *currentPosition)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegExitEntry
- ENDIF
-
- ;
- ; Iterate Entries
- ; Iterate and return entries contained within the entry defined by the current
- ; scope of the iterator. If kRegIterateEmbeddedEntries option was specified when the
- ; iterator was created, all embedded entries will be included in the iteration. If a
- ; property selection (name , value, and size) was specified when the iterator was
- ; created, the only entries having a matching property are returned. Entries are
- ; returned one at a time. When OSStatus == nrIterationDone, all entries have been exhausted, and the
- ; value of nextEntry will be Nil. If changed == true, one or more changes (entry
- ; create or delete) occured since the last interation call.
- ;
- ;
- ; extern OSStatus RegIterateEntries(RegTransaction transaction, RegEntryIterator iterator, RegEntryRef *nextEntry, Boolean *changed)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegIterateEntries
- ENDIF
-
- ;
- ; Restart Entry Iteration
- ; Restart an iteration within the current scope. The iterator is reset such that
- ; iteration of the contents of the currentScope entry can be restarted. The
- ; outermostScope and currentScope of the iterator are unchanged. The currentPosition
- ; for the iterator is set to "nil".
- ;
- ;
- ; extern OSStatus RegRestartEntryIteration(RegEntryIterator iterator)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegRestartEntryIteration
- ENDIF
-
- ;
- ;------------------------------------------------------------------------------------
- ; Adding and Deleting Properties
- ;------------------------------------------------------------------------------------
- ;
- ;
- ; Create Property
- ; A single instance property is created by default. To create a multiple-instance
- ; property set the kRegMultiInstanceProperty option. The next instance of the
- ; property will be created and the instance value will be returned in
- ; propertyInstance.
- ;
- ;
- ; extern OSStatus RegCreateProperty(RegTransaction transaction, const RegEntryRef *entryRef, const char *propertyName, const void *propertyValue, ByteCount propertySize, RegCreatePropertyOptions options, RegPropertyInstance *propertyInstance)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegCreateProperty
- ENDIF
-
- ;
- ; Delete Property
- ; To delete a property the desired property instance(s) must be explicitly
- ; identified. To delete a single instance property set propertyInstance to
- ; kRegNilPropertyInstance. To delete all instances of a multi-instance property, set
- ; propertyInstance to kRegAllPropertyInstances. Otherwise, propertyInstance must
- ; be set to a valid instance value.
- ;
- ;
- ; extern OSStatus RegDeleteProperty(RegTransaction transaction, const RegEntryRef *EntryRef, const char *propertyName, RegPropertyInstance propertyInstance)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegDeleteProperty
- ENDIF
-
- ;
- ;------------------------------------------------------------------------------------
- ; Get/Set Property Values
- ;------------------------------------------------------------------------------------
- ;
- ;
- ; Get/Set the value of the specified property for the specified entry. To get, get
- ; size, and set property values the desired property instance must be explicitly
- ; identified. For single instance properites propertyInstance must be set to
- ; kRegNilPropertyInstance. Otherwise, propertyInstance must be set to a valid
- ; instance value.
- ; Get Property size
- ;
- ;
- ; extern OSStatus RegGetPropertySize(RegTransaction transaction, const RegEntryRef *entryRef, const char *propertyName, RegPropertyInstance propertyInstance, ByteCount *propertySize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegGetPropertySize
- ENDIF
-
- ; Get Property
- ;
- ; extern OSStatus RegGetProperty(RegTransaction transaction, const RegEntryRef *entryRef, const char *propertyName, RegPropertyInstance propertyInstance, void *propertyValue, ByteCount *propertySize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegGetProperty
- ENDIF
-
- ; Set Property
- ;
- ; extern OSStatus RegSetProperty(RegTransaction transaction, const RegEntryRef *entryRef, const char *propertyName, RegPropertyInstance propertyInstance, const void *propertyValue, ByteCount propertySize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegSetProperty
- ENDIF
-
- ;
- ;------------------------------------------------------------------------------------
- ; Iterating Properties
- ;------------------------------------------------------------------------------------
- ;
- ;
- ; Create Property Iterator
- ; Create the property iterator structure. The target entry is defined by entryRef.
- ; If a propertyName is specified, only property instances having the specified name
- ; are returned. If propertyName == nil, all properties are returned.
- ;
- ;
- ; extern OSStatus RegCreatePropertyIterator(RegTransaction transaction, const RegEntryRef *entryRef, const char *propertyName, RegPropertyIterator *iterator)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegCreatePropertyIterator
- ENDIF
-
- ; Dispose Property Iterator
- ;
- ; extern OSStatus RegDisposePropertyIterator(RegPropertyIterator iterator)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegDisposePropertyIterator
- ENDIF
-
- ;
- ; Iterate Properites
- ; Iterate and return properties for given entry. If a propertyName was specified
- ; when the iterator was created, then only property instances for that name are
- ; returned. Otherwise, all properties are returned. The return value in
- ; propertyInstance will be kRegNilPropertyInstance if the property is single
- ; instance. Else it will contain the instance value for the property. If
- ; changed == true, one or more changes (property creates or deletes) occured since the
- ; last iterate call. When OSStatus == nrIterationDone, all properties have been exhausted.
- ;
- ;
- ; extern OSStatus RegIterateProperties(RegTransaction transaction, RegPropertyIterator iterator, char *foundProperty, RegPropertyInstance *propertyInstance, Boolean *changed)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegIterateProperties
- ENDIF
-
- ;
- ; Restart Property Iteration
- ; Used to re-iterate over a list of properties. The Property Iterator is reset to
- ; the beginning of the list of properties for an entry.
- ;
- ;
- ; extern OSStatus RegRestartPropertyIteration(RegPropertyIterator iterator)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegRestartPropertyIteration
- ENDIF
-
- ;
- ;------------------------------------------------------------------------------------
- ; Transaction-control calls
- ;------------------------------------------------------------------------------------
- ;
- ;
- ; Begin Transaction
- ; Marks the beginning of a sequence of Name Registry calls that compose a Registry
- ; transaction. An internal data structure for the transaction is created and a
- ; reference to the transaction is returned in "tranasaction". This reference must be
- ; used with all subsequence Name Registry calls pertaining to the transaction. The
- ; transaction reference must be disposed using a RegCommitTransaction or
- ; RegAbortTranscation call.
- ;
- ;
- ; extern OSStatus RegBeginTransaction(RegTransaction *transaction)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegBeginTransaction
- ENDIF
-
- ;
- ; Commit Transaction
- ; Commits the changes made to the registry for a sepecified transaction. All changes
- ; (entry create/delete, property create/delete, and property value update) made for
- ; the transaction are atomically integrated into the Registry. If result ==
- ; nrTransactionAborted, there was a conflict with changes from some other transaction,
- ; and this transaction was aborted, i.e., no changes for this transaction were made.
- ; In this case the transaction should be repeated.
- ; Note that RegCommitTransaction always disposes the transcation reference
- ; independant of the outcome of the transaction. So to repeat a transaaction you
- ; must start over with a RegBeginTransaction call.
- ;
- ;
- ; extern OSStatus RegCommitTransaction(RegTransaction transaction)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegCommitTransaction
- ENDIF
-
- ;
- ; Abort Transaction
- ; Aborts the changes made to the registry for a sepecified transaction. All changes
- ; (entry create/delete, property create/delete, and property value update) made for
- ; the transaction are disgarded.
- ; RegAbortTransaction also disposes of the transcation reference.
- ;
- ;
- ; extern OSStatus RegAbortTransaction(RegTransaction transaction)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegAbortTransaction
- ENDIF
-
- ENDIF
- IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
- ;
- ;------------------------------------------------------------------------------------
- ; Name Registry Interface for PowerSurge 1.0.2
- ;------------------------------------------------------------------------------------
- ;
- ;
- ; * Name Registry - API for device driver name registration
- ; *
- ; * This interface provides access to the namespace used
- ; * by device drivers. The data structures and entry points
- ; * are specialized and simplified for device driver use.
- ;
- ;
- ; //////////////////////////////////////////////////////////////////////////////
- ;//
- ;// Data Structures
- ;//
- ;
- ;
- ; //////////////////////////////////////////////////////////////////////////////
- ;//
- ;// Foundation Types
- ;//
- ;
- ; Value of a property
- ; typedef void * RegPropertyValue
-
- ; Length of property value
- ; typedef UInt32 RegPropertyValueSize
-
- ;
- ; //////////////////////////////////////////////////////////////////////////////
- ;//
- ;// RegEntryID : The Global x-Namespace Entry Identifier
- ;//
- ;
- ; RegEntryID: The Global Entry ID
- RegEntryID RECORD 0
- f ds RegEntryRef
- sizeof EQU * ; size: $10 (16)
- ENDR
-
-
- ; typedef struct RegEntryID * RegEntryIDPtr
-
- ;
- ; //////////////////////////////////////////////////////////////////////////////
- ;//
- ;// Root Entry Name Definitions (Applies to all Names in the RootNameSpace)
- ;//
- ;// * Names are a colon-separated list of name components. Name components
- ;// may not themselves contain colons.
- ;// * Names are presented as null-terminated ASCII character strings.
- ;// * Names follow similar parsing rules to Apple file system absolute
- ;// and relative paths. However the '::' parent directory syntax is
- ;// not currently supported.
- ;
- ; Max length of Entry Name
-
- kRegCStrMaxEntryNameLength EQU 47
- ; Entry Names are single byte ASCII
- ; typedef char RegCStrEntryName
-
- ; typedef char * RegCStrEntryNamePtr
-
- ; length of RegCStrEntryNameBuf = kRegCStrMaxEntryNameLength+1
- RegCStrEntryNameBuf RECORD 0
- elements ds.b 48
- sizeof EQU * ; size: $30 (48)
- ENDR
-
-
- ; typedef char RegCStrPathName
-
- ; typedef UInt32 RegPathNameSize
-
-
- kRegEntryNameTerminator EQU $00 ; '\0'
- kRegPathNameTerminator EQU $00 ; '\0'
- ;
- ; //////////////////////////////////////////////////////////////////////////////
- ;//
- ;// Property Name and ID Definitions
- ;// (Applies to all Properties Regardless of NameSpace)
- ;
-
- kRegMaximumPropertyNameLength EQU 31 ; Max length of Property Name
- kRegPropertyNameTerminator EQU $00 ; '\0'
- ; typedef char RegPropertyName
-
- ; typedef char * RegPropertyNamePtr
-
- ;
- ; //////////////////////////////////////////////////////////////////////////////
- ;//
- ;// Iteration Operations
- ;//
- ;// These specify direction when traversing the name relationships
- ;
- ; typedef UInt32 RegIterationOp
-
- ; typedef RegIterationOp RegEntryIterationOp
-
-
- ; Absolute locations
- kRegIterRoot EQU $00000002 ; "Upward" Relationships
- kRegIterParents EQU $00000003 ; include all parent(s) of entry
- ; "Downward" Relationships
- kRegIterChildren EQU $00000004 ; include all children
- kRegIterSubTrees EQU $00000005 ; include all sub trees of entry
- kRegIterDescendants EQU $00000005 ; include all descendants of entry
- ; "Horizontal" Relationships
- kRegIterSibling EQU $00000006 ; include all siblings
- ; Keep doing the same thing
- kRegIterContinue EQU $00000001
- ;
- ; //////////////////////////////////////////////////////////////////////////////
- ;//
- ;// Name Entry and Property Modifiers
- ;//
- ;
- ;//
- ;// Modifiers describe special characteristics of names
- ;// and properties. Modifiers might be supported for
- ;// some names and not others.
- ;//
- ;// Device Drivers should not rely on functionality
- ;// specified as a modifier.
- ;
- ; typedef UInt32 RegModifiers
-
- ; typedef RegModifiers RegEntryModifiers
-
- ; typedef RegModifiers RegPropertyModifiers
-
-
- kRegNoModifiers EQU $00000000 ; no entry modifiers in place
- kRegUniversalModifierMask EQU $0000FFFF ; mods to all entries
- kRegNameSpaceModifierMask EQU $00FF0000 ; mods to all entries within namespace
- kRegModifierMask EQU $FF000000 ; mods to just this entry
- ; Universal Property Modifiers
-
- kRegPropertyValueIsSavedToNVRAM EQU $00000020 ; property is non-volatile (saved in NVRAM)
- kRegPropertyValueIsSavedToDisk EQU $00000040 ; property is non-volatile (saved on disk)
- ;
- ; ///////////////////////
- ;//
- ;// The Registry API
- ;//
- ;///////////////////////
- ;
- ;
- ; ///////////////////////
- ;//
- ;// Entry Management
- ;//
- ;///////////////////////
- ;
- ;
- ;-------------------------------
- ; * EntryID handling
- ;
- ;
- ; * Initialize an EntryID to a known invalid state
- ; * note: invalid != uninitialized
- ;
- ;
- ; extern OSStatus RegistryEntryIDInit(RegEntryID *id)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryIDInit
- ENDIF
-
- ;
- ; * Compare EntryID's for equality or if invalid
- ; *
- ; * If a NULL value is given for either id1 or id2, the other id
- ; * is compared with an invalid ID. If both are NULL, the id's
- ; * are consided equal (result = true).
- ;
- ;
- ; extern Boolean RegistryEntryIDCompare(const RegEntryID *id1, const RegEntryID *id2)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryIDCompare
- ENDIF
-
- ;
- ; * Copy an EntryID
- ;
- ;
- ; extern OSStatus RegistryEntryIDCopy(const RegEntryID *src, RegEntryID *dst)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryIDCopy
- ENDIF
-
- ;
- ; * Free an ID so it can be reused.
- ;
- ;
- ; extern OSStatus RegistryEntryIDDispose(RegEntryID *id)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryIDDispose
- ENDIF
-
- ;
- ;-------------------------------
- ; * Adding and removing entries
- ; *
- ; * If (parentEntry) is NULL, the name is assumed
- ; * to be a rooted path. It is rooted to an anonymous, unnamed root.
- ;
- ;
- ; extern OSStatus RegistryCStrEntryCreate(const RegEntryID *parentEntry, const RegCStrPathName *name, RegEntryID *newEntry)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryCStrEntryCreate
- ENDIF
-
- ;
- ; extern OSStatus RegistryEntryDelete(const RegEntryID *id)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryDelete
- ENDIF
-
- ;
- ;---------------------------
- ; * Traversing the namespace
- ; *
- ; * To support arbitrary namespace implementations in the future,
- ; * I have hidden the form that the place pointer takes. The previous
- ; * interface exposed the place pointer by specifying it as a
- ; * RegEntryID.
- ; *
- ; * I have also removed any notion of returning the entries
- ; * in a particular order, because an implementation might
- ; * return the names in semi-random order. Many name service
- ; * implementations will store the names in a hashed lookup
- ; * table.
- ; *
- ; * Writing code to traverse some set of names consists of
- ; * a call to begin the iteration, the iteration loop, and
- ; * a call to end the iteration. The begin call initializes
- ; * the iteration cookie data structure. The call to end the
- ; * iteration should be called even in the case of error so
- ; * that allocated data structures can be freed.
- ; *
- ; * Create(...)
- ; * do {
- ; * Iterate(...);
- ; * } while (!done);
- ; * Dispose(...);
- ; *
- ; * This is the basic code structure for callers of the iteration
- ; * interface.
- ;
-
-
- ;
- ; * create/dispose the iterator structure
- ; * defaults to root with relationship = kRegIterDescendants
- ;
- ;
- ; extern OSStatus RegistryEntryIterateCreate(RegEntryIter *cookie)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryIterateCreate
- ENDIF
-
- ;
- ; extern OSStatus RegistryEntryIterateDispose(RegEntryIter *cookie)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryIterateDispose
- ENDIF
-
- ;
- ; * set Entry Iterator to specified entry
- ;
- ;
- ; extern OSStatus RegistryEntryIterateSet(RegEntryIter *cookie, const RegEntryID *startEntryID)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryIterateSet
- ENDIF
-
- ;
- ; * Return each value of the iteration
- ; *
- ; * return entries related to the current entry
- ; * with the specified relationship
- ;
- ;
- ; extern OSStatus RegistryEntryIterate(RegEntryIter *cookie, RegEntryIterationOp relationship, RegEntryID *foundEntry, Boolean *done)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryIterate
- ENDIF
-
- ;
- ; * return entries with the specified property
- ; *
- ; * A NULL RegPropertyValue pointer will return an
- ; * entry with the property containing any value.
- ;
- ;
- ; extern OSStatus RegistryEntrySearch(RegEntryIter *cookie, RegEntryIterationOp relationship, RegEntryID *foundEntry, Boolean *done, const RegPropertyName *propertyName, const void *propertyValue, RegPropertyValueSize propertySize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntrySearch
- ENDIF
-
- ;
- ;--------------------------------
- ; * Find a name in the namespace
- ; *
- ; * This is the fast lookup mechanism.
- ; * NOTE: A reverse lookup mechanism
- ; * has not been provided because
- ; * some name services may not
- ; * provide a fast, general reverse
- ; * lookup.
- ;
- ;
- ; extern OSStatus RegistryCStrEntryLookup(const RegEntryID *searchPointID, const RegCStrPathName *pathName, RegEntryID *foundEntry)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryCStrEntryLookup
- ENDIF
-
- ;
- ;---------------------------------------------
- ; * Convert an entry to a rooted name string
- ; *
- ; * A utility routine to turn an Entry ID
- ; * back into a name string.
- ;
- ;
- ; extern OSStatus RegistryEntryToPathSize(const RegEntryID *entryID, RegPathNameSize *pathSize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryToPathSize
- ENDIF
-
- ;
- ; extern OSStatus RegistryCStrEntryToPath(const RegEntryID *entryID, RegCStrPathName *pathName, RegPathNameSize pathSize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryCStrEntryToPath
- ENDIF
-
- ;
- ; * Parse a path name.
- ; *
- ; * Retrieve the last component of the path, and
- ; * return a spec for the parent.
- ;
- ;
- ; extern OSStatus RegistryCStrEntryToName(const RegEntryID *entryID, RegEntryID *parentEntry, RegCStrEntryName *nameComponent, Boolean *done)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryCStrEntryToName
- ENDIF
-
- ;
- ; //////////////////////////////////////////////////////
- ;//
- ;// Property Management
- ;//
- ;//////////////////////////////////////////////////////
- ;
- ;
- ;-------------------------------
- ; * Adding and removing properties
- ;
- ;
- ; extern OSStatus RegistryPropertyCreate(const RegEntryID *entryID, const RegPropertyName *propertyName, const void *propertyValue, RegPropertyValueSize propertySize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryPropertyCreate
- ENDIF
-
- ;
- ; extern OSStatus RegistryPropertyDelete(const RegEntryID *entryID, const RegPropertyName *propertyName)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryPropertyDelete
- ENDIF
-
- ;
- ;---------------------------
- ; * Traversing the Properties of a name
- ; *
- ;
-
-
- ;
- ; extern OSStatus RegistryPropertyIterateCreate(const RegEntryID *entry, RegPropertyIter *cookie)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryPropertyIterateCreate
- ENDIF
-
- ;
- ; extern OSStatus RegistryPropertyIterateDispose(RegPropertyIter *cookie)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryPropertyIterateDispose
- ENDIF
-
- ;
- ; extern OSStatus RegistryPropertyIterate(RegPropertyIter *cookie, RegPropertyName *foundProperty, Boolean *done)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryPropertyIterate
- ENDIF
-
- ;
- ; * Get the value of the specified property for the specified entry.
- ; *
- ;
- ;
- ; extern OSStatus RegistryPropertyGetSize(const RegEntryID *entryID, const RegPropertyName *propertyName, RegPropertyValueSize *propertySize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryPropertyGetSize
- ENDIF
-
- ;
- ; * (*propertySize) is the maximum size of the value returned in the buffer
- ; * pointed to by (propertyValue). Upon return, (*propertySize) is the size of the
- ; * value returned.
- ;
- ;
- ; extern OSStatus RegistryPropertyGet(const RegEntryID *entryID, const RegPropertyName *propertyName, void *propertyValue, RegPropertyValueSize *propertySize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryPropertyGet
- ENDIF
-
- ;
- ; extern OSStatus RegistryPropertySet(const RegEntryID *entryID, const RegPropertyName *propertyName, const void *propertyValue, RegPropertyValueSize propertySize)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryPropertySet
- ENDIF
-
- ;
- ; //////////////////////////////////////////////////////
- ;//
- ;// Modibute (err, I mean Modifier) Management
- ;//
- ;//////////////////////////////////////////////////////
- ;
- ;
- ; * Modifiers describe special characteristics of names
- ; * and properties. Modifiers might be supported for
- ; * some names and not others.
- ; *
- ; * Device Drivers should not rely on functionality
- ; * specified as a modifier. These interfaces
- ; * are for use in writing Experts.
- ;
- ;
- ; * Get and Set operators for entry modifiers
- ;
- ;
- ; extern OSStatus RegistryEntryGetMod(const RegEntryID *entry, RegEntryModifiers *modifiers)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryGetMod
- ENDIF
-
- ;
- ; extern OSStatus RegistryEntrySetMod(const RegEntryID *entry, RegEntryModifiers modifiers)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntrySetMod
- ENDIF
-
- ;
- ; * Get and Set operators for property modifiers
- ;
- ;
- ; extern OSStatus RegistryPropertyGetMod(const RegEntryID *entry, const RegPropertyName *name, RegPropertyModifiers *modifiers)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryPropertyGetMod
- ENDIF
-
- ;
- ; extern OSStatus RegistryPropertySetMod(const RegEntryID *entry, const RegPropertyName *name, RegPropertyModifiers modifiers)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryPropertySetMod
- ENDIF
-
- ;
- ; * Iterator operator for entry modifier search
- ;
- ;
- ; extern OSStatus RegistryEntryMod(RegEntryIter *cookie, RegEntryIterationOp relationship, RegEntryID *foundEntry, Boolean *done, RegEntryModifiers matchingModifiers)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryMod
- ENDIF
-
- ;
- ; * Iterator operator for entries with matching
- ; * property modifiers
- ;
- ;
- ; extern OSStatus RegistryEntryPropertyMod(RegEntryIter *cookie, RegEntryIterationOp relationship, RegEntryID *foundEntry, Boolean *done, RegPropertyModifiers matchingModifiers)
- ;
- IF GENERATINGCFM THEN
- IMPORT_CFM_FUNCTION RegistryEntryPropertyMod
- ENDIF
-
- ENDIF
- ENDIF ; __NAMEREGISTRY__
-
-